package com.test.action;

import java.util.List;

import com.test.entity.CardType;
import com.test.entity.News;
import com.test.service.CardTypeService;
import com.test.service.NewsService;

public class CardTypeAction extends BaseAction {
	private NewsService newsService;
	private CardTypeService cardTypeService;
	private String cid;
	private String keyWord;

	public String shows() throws Exception {

		List<News> nlist = newsService.queryNews();
		this.getSession().put("nlist", nlist);
		List<CardType> CardType = cardTypeService.queryCardType();
		this.getSession().put("CardType", CardType);
		return "shows";

	}

	public String Catalog() throws Exception {
		int cids = Integer.parseInt(cid);
		List<CardType> list = cardTypeService.queryCardTypeID(cids);
		this.getRequest().put("list", list);
		List<CardType> list2 = cardTypeService.queryCardType();
		this.getRequest().put("list2", list2);
		return "querysuccess";
	}

	public String keyWord() throws Exception {
		List<CardType> list = cardTypeService.queryCardName(keyWord);
		this.getRequest().put("list", list);
		List<CardType> list2 = cardTypeService.queryCardType();
		this.getRequest().put("list2", list2);
		return "guanlisTypes";
	}

	public NewsService getNewsService() {
		return newsService;
	}

	public void setNewsService(NewsService newsService) {
		this.newsService = newsService;
	}

	public CardTypeService getCardTypeService() {
		return cardTypeService;
	}

	public void setCardTypeService(CardTypeService cardTypeService) {
		this.cardTypeService = cardTypeService;
	}

	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	public String getKeyWord() {
		return keyWord;
	}

	public void setKeyWord(String keyWord) {
		this.keyWord = keyWord;
	}

}
